package com.situ.day6;

import org.junit.Test;

import java.util.Arrays;

public class Demo {
    @Test
    public void test1() {
        Student student1 = new Student();
        student1.name = "zhasngsan";
        student1.show();
        //Static member 'com.situ.day6.Student.country' accessed via instance reference
        System.out.println(student1.country);
        student1.print();
        System.out.println(Student.country);
        Student.print();
        Student.print();
    }

    @Test
    public void test2() {
        int max = Math.max(3, 5);
        System.out.println(max);
        //Math math = new Math();
        int[] array = {34, 45, 7, 89};
        System.out.println(array);
        System.out.println(Arrays.toString(array));
        Arrays.sort(array);
        System.out.println(Arrays.toString(array));
        //[7, 34, 45, 89]
        int index = Arrays.binarySearch(array, 7);
        System.out.println(index);
    }

    @Test
    public void test5() {
        int num = 3;
        Integer integer1 = new Integer(3);
        System.out.println(integer1);
        Integer integer2 = Integer.valueOf(3);
        System.out.println(integer2);
        System.out.println(Integer.MAX_VALUE);
    }

    @Test
    public void test55() {
        Integer integer1 = Integer.valueOf(4);
        System.out.println(integer1);//4

        Integer integer2 = 4;//自动装箱：Integer.valueOf(4);
        System.out.println(integer2);
        //自动拆箱:integer2.intValue()
        int i = integer2.intValue();
        System.out.println(i);
        int num = integer2;
        System.out.println(num);

        Integer integer = 3;
        int num2 = integer + 4;
        integer = integer + 4;
    }

    @Test
    public void test45() {
        String str = "23";
        int i = Integer.parseInt("23");
        double d = Double.parseDouble("3.14");
        // "false" "true"
        boolean bool = Boolean.parseBoolean("false");

        Integer integer = Integer.valueOf("3");
        int i1 = integer.intValue();

        String s = "Hello Java";
        System.out.println(s.toLowerCase());
        System.out.println(s.toUpperCase());
    }
}
